package StructuralPatterns.Adapter;

public class AudioPlayer implements MediaPlayer {

  MediaAdapter mediaAdapter = null;

  @Override
  public void play(String fileName, String type) {
    if (type.equalsIgnoreCase("Mp3")){
      System.out.println("Mp3:" + fileName);
    }else if (type.equalsIgnoreCase("Vlc")||type.equalsIgnoreCase("Mp4")){
      mediaAdapter = new MediaAdapter(type);
      mediaAdapter.play(fileName,type);
    }else {
      System.out.println("Invalid media. " + type + " format not supported");
    }
  }
}
